#include <stdio.h>

int main() {
    char operator;
    double num1, num2;

    printf("输入运算符 (+, -, *, /): ");
    scanf("%c", &operator);

    printf("输入两个数字: ");
    scanf("%lf %lf", &num1, &num2);

    switch(operator) {
        case '+':
            printf("%.1lf + %.1lf = %.1lf", num1, num2, num1 + num2);
            break;
        case '-':
            printf("%.1lf - %.1lf = %.1lf", num1, num2, num1 - num2);
            break;
        case '*':
            printf("%.1lf * %.1lf = %.1lf", num1, num2, num1 * num2);
            break;
        case '/':
            if (num2 != 0.0)
                printf("%.1lf / %.1lf = %.1lf", num1, num2, num1 / num2);
            else
                printf("除数不能为0");
            break;
        default:
            printf("错误! 无效的运算符");
    }

    return 0;
}